package com.slz3.business.module.memberManagement.memShippingAddress.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.memberManagement.memShippingAddress.domain.MemShippingAddress;
import com.slz3.business.module.memberManagement.memShippingAddress.domain.MemShippingAddressCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class MemShippingAddressResController {

    static Mono<ServerResponse> add(ServerRequest req, MemShippingAddress memShippingAddress) {
        if (MemShippingAddressResUnsafeValid.add(req, memShippingAddress)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemShippingAddressResAtomic.add_$MemShippingAddressUpdateLock(req, memShippingAddress);
        }
    }

    static final Mono<ServerResponse> delete(ServerRequest req, MemShippingAddressCondition memShippingAddressCondition) {
        if (MemShippingAddressResUnsafeValid.delete(req, memShippingAddressCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemShippingAddressResAtomic.delete_$MemShippingAddressUpdateLock(req, memShippingAddressCondition);
        }
    }

    static Mono<ServerResponse> modify(ServerRequest req, MemShippingAddress memShippingAddress) {
        if (MemShippingAddressResUnsafeValid.modify(req, memShippingAddress)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemShippingAddressResAtomic.modify_$MemShippingAddressUpdateLock(req, memShippingAddress);
        }
    }

    static Mono<ServerResponse> list(ServerRequest req) {
        if (MemShippingAddressResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemShippingAddressResExecutor.list(req);
        }
    }

    static Mono<ServerResponse> info(ServerRequest req) {
        if (MemShippingAddressResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemShippingAddressResAtomic.info_$MemShippingAddressUpdateLock(req);
        }
    }

    static Mono<ServerResponse> choice(ServerRequest req) {
        if (MemShippingAddressResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemShippingAddressResExecutor.choice(req);
        }
    }

    static final Mono<ServerResponse> auditSubmit(ServerRequest req, MemShippingAddressCondition memShippingAddressCondition) {
        //
        if (MemShippingAddressResUnsafeValid.auditSubmit(req, memShippingAddressCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemShippingAddressResAtomic.auditSubmit_$MemShippingAddressUpdateLock(req, memShippingAddressCondition);
        }
    }

    static final Mono<ServerResponse> audit(ServerRequest req, MemShippingAddressCondition memShippingAddressCondition) {
        if (MemShippingAddressResUnsafeValid.audit(req, memShippingAddressCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemShippingAddressResAtomic.audit_$MemShippingAddressUpdateLock(req, memShippingAddressCondition);
        }
    }

    static final Mono<ServerResponse> auditReject(ServerRequest req, MemShippingAddressCondition memShippingAddressCondition) {
        if (MemShippingAddressResUnsafeValid.auditReject(req, memShippingAddressCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemShippingAddressResAtomic.auditReject_$MemShippingAddressUpdateLock(req, memShippingAddressCondition);
        }
    }

    static final Mono<ServerResponse> usingEnable(ServerRequest req, MemShippingAddressCondition memShippingAddressCondition) {
        if (MemShippingAddressResUnsafeValid.usingEnable(req, memShippingAddressCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemShippingAddressResAtomic.usingEnable_$MemShippingAddressUpdateLock(req, memShippingAddressCondition);
        }
    }

    static final Mono<ServerResponse> usingDisable(ServerRequest req, MemShippingAddressCondition memShippingAddressCondition) {
        if (MemShippingAddressResUnsafeValid.usingDisable(req, memShippingAddressCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MemShippingAddressResAtomic.usingDisable_$MemShippingAddressUpdateLock(req, memShippingAddressCondition);
        }
    }

}
